/*
PLAS_To_AgencyTeam_Test
Description: Test class for Add_AgencyRecordOwner_To_AgencyTeam trigger.
Author: Pratibh Prakash
Created Date: 14 Apr-2009 
*/
@isTest
private class PLAS_To_AgencyTeam_Test {
	static testMethod void test_PLAS_To_AgencyTeam(){
		Profile profile_admin = [select Id from Profile where Name=:'System Administrator'];
		Profile profile_other = [select Id from Profile where Name=:'Custom: Sales Profile'];
		
		User user_admin= [select Id from User where ProfileId=: profile_admin.Id  and IsActive=: true  limit 1];
		User user_other= [select Id from User where ProfileId =: profile_other.Id and IsActive=: true  limit 1];
		
		HR__c objHR_one = new HR__c();
		objHR_one.User__c = user_admin.Id;
		objHR_one.Name = 'TestHR_1';
		HR__c objHR_two = new HR__c();
		objHR_two.User__c = user_other.Id;
		objHR_two.Name = 'TestHR_2';
		HR__c objHR_three = new HR__c();
		
		insert(objHR_one);
		insert(objHR_two);
			
		Account testAcc_one = new Account();
		testAcc_one.Name = 'Test Account';
		testAcc_one.PLAS__c = user_other.Id;
		insert(testAcc_one);
		Account testAcc_two = new Account();
		testAcc_two.Name = 'Test Account';
		testAcc_two.CL_Agency_Specialist__c = user_other.Id;
		insert(testAcc_two);
		Account testAcc_three = new Account();
		testAcc_three.Name = 'Test Account';
		testAcc_three.PL_Agency_Specialist__c = user_other.Id;
		insert(testAcc_three);
		
		
		testAcc_one.OwnerId = user_other.Id;
		testAcc_one.PLAS__c = user_admin.Id;
		update(testAcc_one);	
		
		testAcc_one.OwnerId = user_admin.Id;
		testAcc_one.PLAS__c = null;
		testAcc_one.CL_Agency_Specialist__c = user_other.Id;
		update(testAcc_one);
		
		testAcc_one.OwnerId = user_other.Id;
		testAcc_one.CL_Agency_Specialist__c = null;
		testAcc_one.PL_Agency_Specialist__c = user_admin.Id;
		update(testAcc_one);
		
		testAcc_one.OwnerId = user_admin.Id;
		testAcc_one.PL_Agency_Specialist__c = null;
		update(testAcc_one);
		
		/*
		//testAcc.OwnerId = users[1].Id;
		testAcc.PLAS__c = users[2].Id;
		testAcc.CL_Agency_Specialist__c = users[3].Id;
		testAcc.PL_Agency_Specialist__c = users[0].Id;
		update(testAcc);*/
	}
}